package cheme.Application.ProjectSpaceModel;

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;

import cheme.ProcessEditor.ChemeFileInput;

public class ChemeProjectModel
{
	private static ChemeProjectModel instance = null;
	
//	private List<ChemeFileInput> files = null;
	
	private int newFileCount = 1;

	private ChemeProjectModel()
	{
	}

	public static ChemeProjectModel getInstance()
	{
		if(null == instance)
		{
			instance = new ChemeProjectModel();
		}

		return instance;
	}
	
	public ChemeFileInput getNewFile()
	{
		IWorkspace workspace = ResourcesPlugin.getWorkspace();
		IPath path = workspace.getRoot().getLocation();
//		IPath path = new Path("C:/");
		String fileName =  "New File " + Integer.toString(newFileCount++) + ".cheme";

//		return getFile(null);
		return getFile(path.toString() + "/" + fileName);
	}
	
	public ChemeFileInput getFile(String filePath)
	{
		ChemeFileInput input = new ChemeFileInput(filePath);

		return input;
	}
}
